package fatboy.hypeerweb;
import fatboy.communication.ObjectID;
import fatboy.communication.Location;
import fatboy.communication.RemoteLocation;
import fatboy.communication.Command;
import fatboy.communication.ResidentDatabase;
import java.io.IOException;
import java.io.Serializable;
public class ProxyNode extends Node implements Serializable{
	private ObjectID id;
	private static final long serialVersionUID = 2159800065695342256L;
	public ProxyNode(ObjectID other){
		super();
		id = new ObjectID(other);
	}
	private static Object createCommand(ObjectID idIn, String meth, Class<Object>[] types,
		Object[] params, boolean returns, Location location){
		Object result = null;
		try {
			Command cmd = new Command(idIn,meth,types,params,
			ProxyNode.class.getSuperclass());
			location.sendCommand(cmd);
			result = location.recieveReturn();
			location.close();
		} catch (IOException e) {
			e.printStackTrace();
			} catch (SecurityException e) {
			e.printStackTrace();
			}catch (ClassNotFoundException e) {
			e.printStackTrace();
			}
			return result;
	}
	public Object writeReplace(){
		return this;
	}
	public Object readResolve(){
		if(getLocation(this.id).isHere()){
			return ResidentDatabase.getObject(id);
		}
		return this;
	}
public Location getLocation(ObjectID id) {
	return new RemoteLocation((ObjectID)id);
	}

	public void setId(fatboy.communication.ObjectID param1){
		String meth = "setId";
		Class[] types ={
			fatboy.communication.ObjectID.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public java.util.PriorityQueue getNeighbors(){
		Object ret = null;
		String meth = "getNeighbors";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (java.util.PriorityQueue)ret;
	}
	public fatboy.hypeerweb.Node getNodeAt(fatboy.hypeerweb.NodeAddress param1){
		Object ret = null;
		String meth = "getNodeAt";
		Class[] types ={
			fatboy.hypeerweb.NodeAddress.class
			};
		Object[] params = {
			param1
			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.Node)ret;
	}
	public fatboy.hypeerweb.PointerList getPointers(){
		Object ret = null;
		String meth = "getPointers";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.PointerList)ret;
	}
	public void setUpDownPointers(fatboy.hypeerweb.PointerList param1){
		String meth = "setUpDownPointers";
		Class[] types ={
			fatboy.hypeerweb.PointerList.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	private void setNeighbors(java.util.PriorityQueue param1){
		String meth = "setNeighbors";
		Class[] types ={
			java.util.PriorityQueue.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void setNodeState(fatboy.hypeerweb.NodeType param1){
		String meth = "setNodeState";
		Class[] types ={
			fatboy.hypeerweb.NodeType.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void setFoldPointer(fatboy.hypeerweb.Node param1){
		String meth = "setFoldPointer";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void setChild(fatboy.hypeerweb.Node param1){
		String meth = "setChild";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void setupChild(fatboy.hypeerweb.Node param1){
		String meth = "setupChild";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void setupParent(fatboy.hypeerweb.Node param1){
		String meth = "setupParent";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void addNeighbor(fatboy.hypeerweb.Node param1){
		String meth = "addNeighbor";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void removeNeighbor(fatboy.hypeerweb.Node param1){
		String meth = "removeNeighbor";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public boolean neighborListIsCorrect(){
		Object ret = null;
		String meth = "neighborListIsCorrect";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (Boolean)ret;
	}
	public void removeSurrogatePointerAt(int param1){
		String meth = "removeSurrogatePointerAt";
		Class[] types ={
			int.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void removeSurrogatePointer(fatboy.hypeerweb.NodePointer param1){
		String meth = "removeSurrogatePointer";
		Class[] types ={
			fatboy.hypeerweb.NodePointer.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void addSurrogate(fatboy.hypeerweb.Node param1){
		String meth = "addSurrogate";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void removeEdgePointerAt(int param1){
		String meth = "removeEdgePointerAt";
		Class[] types ={
			int.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void removeEdgePointer(fatboy.hypeerweb.Node param1){
		String meth = "removeEdgePointer";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void addEdgePointer(fatboy.hypeerweb.Node param1){
		String meth = "addEdgePointer";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public fatboy.hypeerweb.PointerList getUpDownPointers(){
		Object ret = null;
		String meth = "getUpDownPointers";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.PointerList)ret;
	}
	public fatboy.hypeerweb.Node getFold(){
		Object ret = null;
		String meth = "getFold";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.Node)ret;
	}
	public fatboy.hypeerweb.Node getFoldPointer(){
		Object ret = null;
		String meth = "getFoldPointer";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.Node)ret;
	}
	public fatboy.hypeerweb.NodeState getNodeState(){
		Object ret = null;
		String meth = "getNodeState";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.NodeState)ret;
	}
	public void removeNeighbors(){
		String meth = "removeNeighbors";
		Class[] types ={

			};
		Object[] params = {

			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void removeNeighbors2(){
		String meth = "removeNeighbors2";
		Class[] types ={

			};
		Object[] params = {

			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void removeSurrogates(){
		String meth = "removeSurrogates";
		Class[] types ={

			};
		Object[] params = {

			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public fatboy.hypeerweb.Node findInsertionPoint(){
		Object ret = null;
		String meth = "findInsertionPoint";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.Node)ret;
	}
	public void removeFold(){
		String meth = "removeFold";
		Class[] types ={

			};
		Object[] params = {

			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void givePointersTo(fatboy.hypeerweb.Node param1){
		String meth = "givePointersTo";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void removeFold2(){
		String meth = "removeFold2";
		Class[] types ={

			};
		Object[] params = {

			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void giveNeighbors(fatboy.hypeerweb.Node param1){
		String meth = "giveNeighbors";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void givePointers(fatboy.hypeerweb.Node param1){
		String meth = "givePointers";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void giveParentChild(fatboy.hypeerweb.Node param1){
		String meth = "giveParentChild";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public void refreshNeighbors(){
		String meth = "refreshNeighbors";
		Class[] types ={

			};
		Object[] params = {

			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public fatboy.hypeerweb.Node getMaximumNeighbor(){
		Object ret = null;
		String meth = "getMaximumNeighbor";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.Node)ret;
	}
	public java.util.Set futureSurrogates(java.util.Collection param1, java.util.Collection param2){
		Object ret = null;
		String meth = "futureSurrogates";
		Class[] types ={
			java.util.Collection.class,
			java.util.Collection.class
			};
		Object[] params = {
			param1,
			param2
			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (java.util.Set)ret;
	}
	public fatboy.hypeerweb.Node findFirstChildlessInRange(fatboy.hypeerweb.Node param1, fatboy.hypeerweb.Node param2){
		Object ret = null;
		String meth = "findFirstChildlessInRange";
		Class[] types ={
			fatboy.hypeerweb.Node.class,
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1,
			param2
			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.Node)ret;
	}
	public boolean addOnto(fatboy.hypeerweb.Node param1){
		Object ret = null;
		String meth = "addOnto";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (Boolean)ret;
	}
	public void addFold(){
		String meth = "addFold";
		Class[] types ={

			};
		Object[] params = {

			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public synchronized fatboy.hypeerweb.Node add(fatboy.hypeerweb.Node param1){
		Object ret = null;
		String meth = "add";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.Node)ret;
	}
	public boolean equals(java.lang.Object param1){
		Object ret = null;
		String meth = "equals";
		Class[] types ={
			java.lang.Object.class
			};
		Object[] params = {
			param1
			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (Boolean)ret;
	}
	public java.lang.String toString(){
		Object ret = null;
		String meth = "toString";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (java.lang.String)ret;
	}
	public int hashCode(){
		Object ret = null;
		String meth = "hashCode";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (Integer)ret;
	}
	public int compareTo(java.lang.Object param1){
		Object ret = null;
		String meth = "compareTo";
		Class[] types ={
			java.lang.Object.class
			};
		Object[] params = {
			param1
			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (Integer)ret;
	}
	public fatboy.hypeerweb.NodeAddress getAddress(){
		Object ret = null;
		String meth = "getAddress";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.NodeAddress)ret;
	}
	public fatboy.hypeerweb.Node getParent(){
		Object ret = null;
		String meth = "getParent";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.Node)ret;
	}
	public synchronized fatboy.hypeerweb.Node remove(fatboy.hypeerweb.Node param1){
		Object ret = null;
		String meth = "remove";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.Node)ret;
	}
	public fatboy.communication.ObjectID getId(){
		Object ret = null;
		String meth = "getId";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.communication.ObjectID)ret;
	}
	public void setParent(fatboy.hypeerweb.Node param1){
		String meth = "setParent";
		Class[] types ={
			fatboy.hypeerweb.Node.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
	public boolean accept(fatboy.addons.Visitor param1, java.lang.Object param2){
		Object ret = null;
		String meth = "accept";
		Class[] types ={
			fatboy.addons.Visitor.class,
			java.lang.Object.class
			};
		Object[] params = {
			param1,
			param2
			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (Boolean)ret;
	}
	public fatboy.hypeerweb.Node getChild(){
		Object ret = null;
		String meth = "getChild";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.Node)ret;
	}
	public fatboy.hypeerweb.NodeType getNodeType(){
		Object ret = null;
		String meth = "getNodeType";
		Class[] types ={

			};
		Object[] params = {

			};
		ret = createCommand(id,meth,types,params,true, getLocation(id));
		return (fatboy.hypeerweb.NodeType)ret;
	}
	public void setAddress(fatboy.hypeerweb.NodeAddress param1){
		String meth = "setAddress";
		Class[] types ={
			fatboy.hypeerweb.NodeAddress.class
			};
		Object[] params = {
			param1
			};
		createCommand(id,meth,types,params,false, getLocation(id));
	}
}

